Skip to main content

Batch Query Sub-Account Spot Balances

Type: GET

Description: /v4/broker/balances

Base URL: https://sapi.xt.com (spot domain)

Batch queries the spot assets of sub-accounts belonging to the broker. Sign the request with the broker master account's API Key. Use either subAccountIds for point queries or cursor/limit to traverse all sub-accounts; do not use both.

Parameters​

NameTypeMandatoryDefaultDescriptionRanges
subAccountIdsstringfalse-Comma-separated sub-account ids; mutually exclusive with cursorUp to 100 ids
cursorlongfalse-Id of the last sub-account on the previous page; sub-accounts are traversed in ascending id order-
limitintfalse50Items per page1-100
currenciesstringfalse-Comma-separated currencies. If omitted, only currencies with a balance are returned. A non-existent currency returns a parameter errorUp to 20 currencies
summaryOnlybooleanfalsefalseIf true, only converted totals are returned, without per-currency detailstrue / false

Request Example​

curl -X GET 'https://sapi.xt.com/v4/broker/balances?limit=50&summaryOnly=true' \
-H 'validate-algorithms: HmacSHA256' \
-H 'validate-appkey: {accessKey}' \
-H 'validate-recvwindow: 5000' \
-H 'validate-timestamp: {timestamp}' \
-H 'validate-signature: {signature}'

Response Example​

Response
{
"rc": 0,
"mc": "SUCCESS",
"result": {
"items": [
{
"subAccountId": 10645823292041,
"totalUsdtAmount": "0.0000",
"totalBtcAmount": "0.00000000",
"assets": []
}
],
"hasNext": true,
"nextCursor": 10645823357632,
"timestamp": 1792149633665
}
}

Response Parameters​

NameTypeDescription
items[].subAccountIdlongSub-account id
items[].totalUsdtAmountstringTotal assets converted to USDT
items[].totalBtcAmountstringTotal assets converted to BTC
items[].assetsarrayPer-currency asset details; empty when summaryOnly=true
hasNextbooleanWhether there is a next page
nextCursorlongCursor for the next page; null when there is no next page
timestamplongResponse timestamp (milliseconds)